<?php
/**
 *@author Connor <caokang@foxmail.com>
 *@todo
 *@link www.zeevin.com
 */
class Profile extends CActiveRecord{

	public static function model($className=__CLASS__){
		return parent::model($className);
	}

	public function tableName(){
		return 'space_profile';
	}

	public function attributeLabels(){
		return array(
			'weight'=>'体重',
			'zodiac'=>'生肖',
			'nationality'=>'民族',
			'faith'=>'信仰',
			'corp'=>'公司',
			'fav_sports'=>'喜欢的运动',
			'fac_moves'=>'喜欢的电影',
			'fav_colours'=>'喜欢的颜色',
			'body_size'=>'体型',
			'constellation'=>'星座',
			'blood_type'=>'血型',
			'graduate_school'=>'毕业学校',
			'career'=>'职业',
			'fav_food'=>'喜欢的食物',
			'fav_musics'=>'喜欢的音乐',
			);
	}
	public function rules(){
		return array(
			array('weight,zodiac,nationality,faith,corp,fav_sports,fac_moves,fav_colours,
				body_size,constellation,blood_type,graduate_school,career,fav_food,fav_musics,
				graduateyear,goodat,personality,drink,smoke,exercising,habits,incomes,majors,hobby,fav_product,fav_book,
				black_1,black_2,black_3,black_4,black_5,black_6,black_7,black_8','safe'),
			);
	}

	protected function beforeSave(){
		$this->uid=Yii::app()->user->id;
		return true;
	}

}